<script language="JavaScript">
function myrefresh(){
    window.location.reload();
}
setTimeout('myrefresh()',15000); //指定5秒刷新一次
</script>
<?php
exit('shit!');
#   require('/opt/php/xhprof/xhprofStart.php');
define('WEB_SERVER_ROOT_PATH',  '/opt/php/sns/');
require(WEB_SERVER_ROOT_PATH. 'config/config.php');
$startMicroTime =   UK::getMicroTime();

$hostUid    =   DOP::request('hostUid');
define('HOST_UID', $hostUid);


# $uidArray   =   array(2550624, 2668290, 2668271, 2545450, 2543896, 2299325, 2668806);
# $uidArray   =   array(2669057, 2549974, 2363591, 2530389, 2236899, 2668814);
if (empty($_REQUEST['uid']))    $uidArray   =   array(1);
else
{
    $uidArray   =   explode(',', $_REQUEST['uid']);
}

$chatController         =   new ChatController();
$commentController      =   new CommentController();
$diaryController        =   new DiaryController();
$feedController         =   new FeedController();
$followController       =   new FollowController();
$hotSquareController    =   new HotSquareController();
$likeController         =   new LikeController();
$messageBoxController   =   new MessageBoxController();
$userController         =   new UserController();
$cloudSyncController    =   new CloudSyncController();


echo 'B Now time : ', AC::SERVER_TIME, ' ---   ',  date('Y-m-d H:i:s', AC::SERVER_TIME), '<br />';
if (empty($uidArray))
{
    exit ('No User uid info');
}

# UserController    /*{{{*/
echo '<fieldset><legend>UserController</legend>';
echo '
    <table>
        <tr>
            <td>uid</td>
            <td>account</td>
            <td>nickname</td>
            <td>email</td>
            <td>diaryNum</td>
            <td>meCommentNum</td>
            <td>commentMeNum</td>
            <td>meFollowNum</td>
            <td>followMeNum</td>
            <td>meLkieNum</td>
            <td>likeMeNum</td>
            <td>messageNum</td>
            <td>syncNum</td>
        </tr>';
foreach ($uidArray  as  $uid)
{
    $info   =   $userController->getUserInfo(array('uid' => $uid));
    $syncs  =   $cloudSyncController->cloudSyncCount(array('uid' => $uid));
    if (empty($info)    ||  !is_array($info))   continue;
    echo '
        <tr>
            <td>'. $uid. '</td>
            <td>'. $info['userInfo']['account']. '</td>
            <td>'. $info['userInfo']['nickname']. '</td>
            <td>'. $info['userInfo']['email']. '</td>
            <td>'. $info['userStatistics']['diaryTimes']. '</td>
            <td>'. $info['userStatistics']['commentTimes']. '</td>
            <td>'. $info['userStatistics']['commentMeTimes']. '</td>
            <td>'. $info['userStatistics']['meFollowTimes']. '</td>
            <td>'. $info['userStatistics']['followMeTimes']. '</td>
            <td>'. $info['userStatistics']['likeTimes']. '</td>
            <td>'. $info['userStatistics']['likeMeTimes']. '</td>
            <td>'. $info['userStatistics']['messageTimes']. '</td>
            <td>'. $syncs['num']. '</td>
        </tr>';
}
echo '</table></fieldset><br />', "\r\n";
/*}}}*/

# chatController    /*{{{*/
echo '<fieldset><legend>ChatController</legend>';
$info   =   $chatController->getChatList(NULL);
if (empty($info))
{
    echo 'No chat info!';
}
echo '
    <table>
        <tr>
            <td>uid</td>
            <td>nickname</td>
            <td>device</td>
            <td>content</td>
            <td>time</td>
            <td>date</td>
        </tr>';
foreach ($info  as  $chat)
{
    echo '
        <tr>
            <td>'. $chat['uid']. '</td>
            <td>'. $chat['nickname']. '</td>
            <td>'. $chat['device']. '</td>
            <td>'. $chat['content']. '</td>
            <td>'. $chat['time']. '</td>
            <td>'. date('H:i:s', $chat['time']). '</td>
        </tr>';
}
echo '</table></fieldset><br />', "\r\n";
/*}}}*/

# hotSquareController   /*{{{*/
echo '<fieldset><legend>HotSquareController</legend>';
$info   =   $hotSquareController->getSquareList(NULL);
if (empty($info))
{
    echo 'No hotSquare info!';
}
echo '
    <table>
        <tr>
            <td>id</td>
            <td>eUid</td>
            <td>eNickname</td>
            <td>bodyId</td>
            <td>type</td>
            <td>content</td>
            <td>date</td>
            <td>title</td>
            <td>abbreviation</td>
            <td>commentTimes</td>
            <td>likeTimes</td>
        </tr>';
foreach ($info  as  $square)
{
    echo '
        <tr>
            <td>'. $square['id']. '</td>
            <td>'. $square['eUid']. '</td>
            <td>'. $square['eNickname']. '</td>
            <td>'. $square['bodyId']. '</td>
            <td>'. $square['type']. '</td>
            <td>'. $square['content']. '</td>
            <td>'. date('H:i:s', $square['time']). '</td>
            <td>'. $square['detail']['title']. '</td>
            <td>'. $square['detail']['abbreviation']. '</td>
            <td>'. $square['detail']['commentTimes']. '</td>
            <td>'. $square['detail']['likeTimes']. '</td>
        </tr>';
}
echo '</table></fieldset><br />', "\r\n";
/*}}}*/

# feedController    /*{{{*/
echo '<fieldset><legend>FeedController</legend>';
echo '
    <table>
        <tr>
            <td>id</td>
            <td>uid</td>
            <td>eUid</td>
            <td>eNickname</td>
            <td>authorUid</td>
            <td>authorNickname</td>
            <td>bodyId</td>
            <td>type</td>
            <td>subType</td>
            <td>content</td>
            <td>date</td>
            <td>title</td>
            <td>abbreviation</td>
            <td>commentTimes</td>
            <td>likeTimes</td>
        </tr>';
foreach ($uidArray  as  $uid)
{
    $info   =   $feedController->getFeedList(array('uid' => $uid));
    if (empty($info)    ||  !is_array($info))   continue;
    foreach ($info  as  $feed)
    {
        echo '
            <tr>
                <td>'. $feed['id']. '</td>
                <td>'. $feed['uid']. '</td>
                <td>'. $feed['eUid']. '</td>
                <td>'. $feed['eNickname']. '</td>
                <td>'. $feed['authorUid']. '</td>
                <td>'. $feed['authorNickname']. '</td>
                <td>'. $feed['bodyId']. '</td>
                <td>'. $feed['type']. '</td>
                <td>'. $feed['subType']. '</td>
                <td>'. $feed['content']. '</td>
                <td>'. date('H:i:s', $feed['time']). '</td>
                <td>'. $feed['detail']['title']. '</td>
                <td>'. $feed['detail']['abbreviation']. '</td>
                <td>'. $feed['detail']['commentTimes']. '</td>
                <td>'. $feed['detail']['likeTimes']. '</td>
            </tr>';
    }
}
echo '</table></fieldset><br />', "\r\n";
/*}}}*/

# commentController     /*{{{*/
echo '<fieldset><legend>CommentController</legend>';
echo '
    <table>
        <tr>
            <td>uid</td>
            <td>cUid</td>
            <td>cNickname</td>
            <td>bodyId</td>
            <td>type</td>
            <td>content</td>
            <td>date</td>
            <td>title</td>
            <td>abbreviation</td>
            <td>commentTimes</td>
            <td>likeTimes</td>
        </tr>';
foreach ($uidArray  as  $uid)
{
    $comment    =   $commentController->getMeCommentList(array('uid' => $uid));
    if (empty($comment) ||  !is_array($comment))    continue;
    foreach ($comment   as  $info)
    {
        echo '
            <tr>
                <td>'. $info['uid']. '</td>
                <td>'. $info['cUid']. '</td>
                <td>'. $info['cNickname']. '</td>
                <td>'. $info['bodyId']. '</td>
                <td>'. $info['type']. '</td>
                <td>'. $info['content']. '</td>
                <td>'. date('H:i:s',$info['time']). '</td>
                <td>'. $info['detail']['title']. '</td>
                <td>'. $info['detail']['abbreviation']. '</td>
                <td>'. $info['detail']['commentTimes']. '</td>
                <td>'. $info['detail']['likeTimes']. '</td>
            </tr>';
    }
}
echo '</table></fieldset><br />', "\r\n";
/*}}}*/

# diaryController   /*{{{*/
echo '<fieldset><legend>DiaryController</legend>';
echo '
    <table>
        <tr>
            <td>uid</td>
            <td>bodyId</td>
            <td>title</td>
            <td>abbreviation</td>
            <td>commentTimes</td>
            <td>likeTimes</td>
            <td>attachmentPath</td>
        </tr>';
foreach ($uidArray  as  $uid)
{
    $diary  =   $diaryController->getDiaryList(array('uid' => $uid));
    if (empty($diary)   ||  !is_array($diary))  continue;
    foreach ($diary     as  $info)
    {
        echo '
            <tr>
                <td>'. $info['uid']. '</td>
                <td>'. $info['bodyId']. '</td>
                <td>'. $info['title']. '</td>
                <td>'. $info['abbreviation']. '</td>
                <td>'. $info['commentTimes']. '</td>
                <td>'. $info['likeTimes']. '</td>
                <td>'. $info['attachmentPath']. '</td>
            </tr>';
    }
}
echo '</table></fieldset><br />', "\r\n";
/*}}}*/

# followController  /*{{{*/
echo '<fieldset><legend>FollowController</legend>';
echo '
    <table>
        <tr>
            <td>uid</td>
            <td>fUid</td>
            <td>fNickname</td>
            <td>type</td>
        </tr>';
foreach ($uidArray  as  $uid)
{
    $follow =   $followController->getMeFollowList(array('uid' => $uid));
    if (is_array($follow))
    foreach ($follow    as  $info)
    {
        echo '
            <tr>
                <td>'. $info['uid']. '</td>
                <td>'. $info['fUid']. '</td>
                <td>'. $info['userInfo']['nickname']. '</td>
                <td>'. $info['type']. ': 关注</td>
            </tr>';
    }
    $follow =   $followController->getFollowMeList(array('uid' => $uid));
    if (is_array($follow))
    foreach ($follow    as  $info)
    {
        echo '
            <tr>
                <td>'. $info['uid']. '</td>
                <td>'. $info['fUid']. '</td>
                <td>'. $info['userInfo']['nickname']. '</td>
                <td>'. $info['type']. ': 粉丝</td>
            </tr>';
    }
}
echo '</table></fieldset><br />', "\r\n";
/*}}}*/

# likeController    /*{{{*/
echo '<fieldset><legend>LikeController</legend>';
echo '
    <table>
        <tr>
            <td>lUid</td>
            <td>lNickname</td>
            <td>bodyId</td>
            <td>type</td>
            <td>date</td>
            <td>title</td>
            <td>abbreviation</td>
            <td>commentTimes</td>
            <td>likeTimes</td>
        </tr>';
foreach ($uidArray  as  $uid)
{
    $like   =   $likeController->getMeLikeList(array('uid' => $uid));
    if (empty($like)    ||  !is_array($like))   continue;
    foreach ($like  as  $info)
    {
    echo '
        <tr>
            <td>'. $info['lUid']. '</td>
            <td>'. $info['lNickname']. '</td>
            <td>'. $info['bodyId']. '</td>
            <td>'. $info['type']. '</td>
            <td>'. date('H:i:s', $info['time']). '</td>
            <td>'. $info['detail']['title']. '</td>
            <td>'. $info['detail']['abbreviation']. '</td>
            <td>'. $info['detail']['commentTimes']. '</td>
            <td>'. $info['detail']['likeTimes']. '</td>
        </tr>';
    }
}
echo '</table></fieldset><br />', "\r\n";
/*}}}*/

# messageBoxController  /*{{{*/
echo '<fieldset><legend>MessageBoxController</legend>';
echo '
    <table>
        <tr>
            <td>uid</td>
            <td>mUid</td>
            <td>mNickname</td>
            <td>date</td>
            <td>unReadNum</td>
            <td>updateTime</td>
            <td>lastContent</td>
        </tr>';
foreach ($uidArray  as  $uid)
{
    $info   =   $messageBoxController->getMessageList(array('uid' => $uid));
    if (empty($info)    ||  !is_array($info))   continue;
    foreach ($info  as  $message)
    {
        echo '
            <tr>
                <td>'. $message['uid']. '</td>
                <td>'. $message['mUid']. '</td>
                <td>'. $message['mNickname']. '</td>
                <td>'. date('H:i:s', $message['time']). '</td>
                <td>'. $message['unReadNum']. '</td>
                <td>'. $message['updateTime']. '</td>
                <td>'. $message['lastContent']. '</td>
            </tr>';
    }
}
echo '</table></fieldset><br />', "\r\n";
/*}}}*/


$endMicroTime   =   UK::getMicroTime();

echo ' <br />  Run Time : ', ($endMicroTime - $startMicroTime), ' ---! ';
#   require('/opt/php/xhprof/xhprofEnd.php');
